package modelcontroller;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Mariam
 */
public class Conversation {

    private User remoteUser;
    private String history;

    public Conversation(User remoteUser) {
        this.remoteUser = remoteUser;
        this.history = "";
    }

    public User getRemoteUser() {
        return remoteUser;
    }

    public String getHistory() {
        return history;
    }

    public void addMessage(String msg) {
        DateFormat dateFormat = new SimpleDateFormat("hh:mm");
        Date date = new Date();
        this.history = this.getHistory() + "\n [" + dateFormat.format(date) + "] " + msg;
        System.out.println(this.history);
    }
}
